package wjl.project.dubbotestshop;


import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import wjl.project.dubbotestshop.DesignMode.PayFactory;

import javax.annotation.Resource;

@RestController

public class BuyController {
    @Resource
    GoodsService goodsService;

    @PostMapping("/buy")
    public String buyGoods(@RequestParam Long goodsId){
//        return  goodsService.buyGoods(goodsId)?"消费成功":"消费失败";
        return goodsService.buyGoodsSync(goodsId)?"success":"fail";
    }



}
